layout (location = 0) out vec4 eceGlPosition;
layout (location = 1) out vec4 eceGlNormal;
layout (location = 2) out vec4 eceGlAlbedoSpec;

uniform ece_Material material;
uniform sampler2D normalMapping;
uniform sampler2D texture;
varying vec2 vTexCoord;
varying float vDistance;
varying vec3 vPosition;
varying mat3 vTBN;
void main() {
	vec3 normal = normalize(texture2D(normalMapping, vTexCoord).xyz * 2.0 - 1.0);
	vec4 baseColor = texture2D(texture, vTexCoord);
	eceGlPosition.rgb = vPosition;
	eceGlPosition.a = vDistance;
	eceGlNormal.rgb = vTBN * normal;
	eceGlNormal.a = material.enable ? material.shininess : 24;
	eceGlAlbedoSpec.rgb = material.enable ? baseColor.rgb * material.diffuse : baseColor.rgb;
	eceGlAlbedoSpec.a = material.specular.r;
}